<template>
  <!--<my-info></my-info>-->
  <div>
    <artist-apply-steps :active="active"></artist-apply-steps>
  </div>


</template>

<script>
    import {playlistComment, playlist} from  './../service/getData';
    import SongSheetList from "../components/songSheetList";
    import SongList from "../components/songList";
    import CommentList from "../components/commentList";
    import MyInfo from "./myInfo";
    import Pagination from '../components/pagination'
    import ArtistApplySteps from '../components/artist-apply-steps'
    export default {
      name: "test",
      components: {ArtistApplySteps, MyInfo, CommentList, SongList, SongSheetList, Pagination},
      data () {
        return {
          active: 0,
//        msg: 'this is the content of area'
          comments: [],
          list: [],
          commentForm: {
            comment: ''
          },
          pageNum: 1,
          pageSize: 10,
          pages: 20,
          targetId: 2286380125
        }
      },
      methods: {
        getCommentsWithPageNum (pageNum) {
          this.comments = []
          let _this = this;
          playlistComment(this).get({
            playlistId: _this.targetId,
            pageNum: pageNum,
            pageSize: _this.pageSize
          }).then(res => {
            console.log(res);
            let status = res.body.status;
            if (status === 200) {
              _this.comments = res.body.data.rows;
              _this.pageNum = res.body.data.page;
              _this.pages = res.body.data.pages;
            }
          });
        },
        getPlaylistsWithPageNum (pageNum) {
          let _this = this;
          _this.list = [];
          playlist(this).get({
            playlist: 'playlist',
            pageNum: pageNum,
            pageSize: 15
          }).then(res => {
            console.log(res);
            let status = res.body.status;
            if (status === 200) {
              let data = res.body.data;
              _this.pageNum = data.page;
              _this.pages = data.pages;
              _this.list = data.rows;
            }
          });
        }
      },
      mounted(){
        this.getCommentsWithPageNum(this.pageNum)
        // this.getPlaylistsWithPageNum (this.pageNum)
      },
    }
</script>

<style scoped>

</style>
